<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<div class="widget-box">
	<div class="widget-header header-color-pink">
		<h5><i class="icon-table"></i>渗压计传感器列表</h5>
		<div class="widget-toolbar no-border">
			<button id="export" onclick="exportExcel('/export/osmometer');" class="btn btn-xs bigger btn-yellow dropdown-toggle">
				<i class="icon-download-alt"> 导出Excel</i>
			</button>
			<c:if test="${sessionScope['ABKJ-PT-ACCOUNT'].type ==1}">
			<button id="add" onclick="trans2('/sensor/osmometer_add');" class="btn btn-xs bigger btn-yellow dropdown-toggle">
				<i class="icon-pencil"> 添加渗压计</i>
			</button>
			</c:if>
			<button id="refresh" onclick="trans2('/sensor/osmometer');" class="btn btn-xs bigger btn-yellow dropdown-toggle">
				<i class="icon-refresh"> 刷新</i>
			</button>
		</div>
	</div>
	<div class="widget-body">
	<%-- <div class="widget-toolbox padding-2 clearfix">
		<form id="searchForm" class="form-inline" role="form">
			<div class="form-group">
				<input type="text" class="form-control" id="name" name="name" value="${name}" placeholder="传感器名称">
			</div>


			<button type="button" onclick="toPage(1)" class="btn btn-default  btn-sm">查询 <i class="icon-search icon-on-right bigger-110"></i></button>
		</form>
	</div> --%>
		<div class="widget-main no-padding">
			<table class="table table-striped table-bordered table-hover">
				<thead class="thin-border-bottom">
					<tr>
						<th class='center'>ID</th>
						<th class='center'>编号</th>
						<th class='center'>名称</th>
						<th class='center'>安装断面</th>
						<th class='center'>安装埋深(cm)</th>
						<th class='center'>是否启用</th>
						<th class='center'>通信状态</th>
						<th class='center'>操作</th>
					</tr>
				</thead>

				<tbody>
					<c:forEach items="${osmometers}" var="osmometer" varStatus="pageStatus">
						<tr>
							<td class='center'>${osmometer.id}</td>
							<td class='center'>${osmometer.code}</td>
							<td class='center'>${osmometer.name}</td>
							<td class='center'>${osmometer.sectdes}</td>
							<td class='center'>${osmometer.depth}</td>
							<td class='center'>${osmometer.state==0?'启用':'禁用'}</td>
							<td class='center'>${osmometer.info==0?'正常':'异常'}</td>
							<td class='center'>&nbsp; <c:if test="${sessionScope['ABKJ-PT-ACCOUNT'].type ==1}">
									<button onclick="trans2('/sensor/osmometer_update?osmometerId=${osmometer.id}');" class="btn btn-xs btn-info tooltip-info" data-toggle="tooltip" data-placement="top" data-original-title="编辑">
										<i class="icon-edit bigger-110"></i>编辑
									</button>
									<button onclick="sensor_zero('${osmometer.code}','osmometer','${osmometer.id}',0);" class="btn btn-xs btn-info tooltip-info" data-toggle="tooltip" data-placement="top"
										data-original-title="编辑">
										<i class="icon-refresh bigger-110"></i>调零
									</button>
								</c:if>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	</div>
<!-- 分页开始 -->
<%-- <input type="hidden" id="pageurl" value="${root}/restrt/restrt"/>
<input type="hidden" id="pageform" value="searchForm"/>
<jsp:include page="../page.jsp"></jsp:include> --%>
<!-- 分页结束 -->

<script type="text/javascript">
	function exportExcel(urlStr){
		var url = "/tail/" + urlStr;
		window.open(url);
	}
</script>
